#include <cstdio>
#include <algorithm>
using namespace std;
const int MAXN=100050;
long long a[MAXN];
int main(void){
    for(int i=1;i<=100000;i++){
        a[i]=a[i-1]+i;
    }
    int n;
    while(~scanf("%d",&n)){
        if(n==0){
            break;
        }
        if(a[n]%2==0){
            printf("Y\n");
        }
        else{
            printf("N\n");
        }
    }
}
